package cn.senjoeson.healthsport.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import cn.senjoeson.healthsport.bean.StepData;
import cn.senjoeson.healthsport.bean.User;

import cn.senjoeson.healthsport.dao.StepDataDao;
import cn.senjoeson.healthsport.dao.UserDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig stepDataDaoConfig;
    private final DaoConfig userDaoConfig;

    private final StepDataDao stepDataDao;
    private final UserDao userDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        stepDataDaoConfig = daoConfigMap.get(StepDataDao.class).clone();
        stepDataDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        stepDataDao = new StepDataDao(stepDataDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);

        registerDao(StepData.class, stepDataDao);
        registerDao(User.class, userDao);
    }
    
    public void clear() {
        stepDataDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
    }

    public StepDataDao getStepDataDao() {
        return stepDataDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

}
